<h2>Tvarkyti žodynus</h2>
<div id="manage_dicts_action">
	<form id="manage_dicts_form">
		<select style="width:25%" name="subscribed" id="subscribed_select"></select>
		<button id="subscribed_all" onclick="click_subscribed()">&lt;--&gt;</button>
		<select style="width:25%" name="rest" id="rest_select"></select>
		<button id="all_managed" onclick="click_managed()">&lt;--&gt;</button>
		<select style="width:25%" name="managed" id="managed_select"></select>
		<p>
		<label for="dict_name_input">Žodyno pavadinimas</label><input type="text" id="dict_name_input"/>
		</p><p>
		<label for="dict_description_input">Žodyno aprašymas</label><textarea rows="4" cols="50" id="dict_description_ta">&nbsp;</textarea>
		</p>
		<table id="manage_dicts_table" class="table">
			<tr>
				<th>Nr.</th>
				<th>Pavadinimas</th>
				<th>Aprašymas</th>
				<th>Atsijungti</th>
				<th>Prenumeruoti</th>
				<th>Valdyti</th>
				<th>Originalus pavadinimas</th>
			</tr>
			<?php
			foreach($modeldata['dicts'] as $index => $dict) {
				echo "<tr>\n";
				echo "<td class=\"td_right\">" . ($index + 1) . ".</td>\n";
				echo "<td class=\"td_left\" name=\"dict_name\" dict_index=\"" . $dict["id"] . "\">" . $dict["name"] . "</td>\n";
				echo "<td class=\"td_left\">" . $dict["descr"] . "</td>\n";
				echo "<td class=\"td_center\">";
					echo "<input type=\"radio\" value=\"release\" name=\"" . $dict["id"] . "\"";
					if ($dict["subscribed"]) echo " checked=\"checked\"";
					echo "/>";
				echo "</td>\n";
				echo "<td class=\"td_center\">";
					echo "<input type=\"radio\" value=\"subscribe\" name=\"" . $dict["id"] . "\"";
					if (!$dict["subscribed"] && !$dict["managed"]) echo " checked=\"checked\"";
					echo "/>";
				echo "</td>\n";
				echo "<td class=\"td_center\">";
					echo "<input type=\"radio\" value=\"manage\" name=\"" . $dict["id"] . "\"";
					if ($dict["managed"]) echo " checked=\"checked\"";
					echo "/>";
				echo "</td>\n";
				echo "<td class=\"td_left\" id=\"new_name_" . $dict["id"] . "\"></td>";
				echo "\n</tr>\n";
			}	 /**/
			?>
		</table>
		<br />
		<button id="manage_dicts_button" 
				type="button"
				form="manage_dicts_form"
				onclick="manageDicts()">Atlikti
		</button>
	</form>					
</div><!-- #manage_dicts_action -->